
uniform float		colorScale;
uniform float		colorBias;
uniform mat4		bumpMatrix;
uniform mat4		diffuseMatrix;
uniform mat4		lightMatrix;

varying vec2		bumpTexCoord;
varying vec2		diffuseTexCoord;
varying vec4		lightTexCoord;
varying vec4		vertexColor;


void main (void){

	// Position invariant
	gl_Position = ftransform();

	// Transform the bump map texcoord
	bumpTexCoord.s = dot(gl_MultiTexCoord0, bumpMatrix[0]);
	bumpTexCoord.t = dot(gl_MultiTexCoord0, bumpMatrix[1]);

	// Transform the diffuse map texcoord
	diffuseTexCoord.s = dot(gl_MultiTexCoord0, diffuseMatrix[0]);
	diffuseTexCoord.t = dot(gl_MultiTexCoord0, diffuseMatrix[1]);

	// Compute the light projection/falloff texcoord
	lightTexCoord.s = dot(gl_Vertex, lightMatrix[0]);
	lightTexCoord.t = dot(gl_Vertex, lightMatrix[1]);
	lightTexCoord.p = dot(gl_Vertex, lightMatrix[2]);
	lightTexCoord.q = dot(gl_Vertex, lightMatrix[3]);

	// Compute the vertex color
	vertexColor = gl_Color * colorScale + colorBias;
}
